<{include file="admin/header.html"}>
<link href="<{$smarty.const.STATIC_COMPONENT_URL}>css/jquery-ui.css" type="text/css" rel="stylesheet" />
<script src="<{$smarty.const.STATIC_COMPONENT_URL}>js/jquery-1.7.1.js"></script>
<script src="<{$smarty.const.STATIC_COMPONENT_URL}>js/jquery.ui.core.js"></script>
<script src="<{$smarty.const.STATIC_COMPONENT_URL}>js/jquery.ui.widget.js"></script>
<script src="<{$smarty.const.STATIC_COMPONENT_URL}>js/jquery.ui.datepicker.js"></script>
<script type="text/javascript">
$(function() {
	$( "#datepicker" ).datepicker();
});
function filterp(){
	url = '<{$smarty.const.APPLICATION_URL}>/admin/visitor';
	if (document.filter.date_create.value != '')
		url += '/date_create/' + URLEncode(document.filter.date_create.value);
	window.location = url;
}
</script>
<div class="tabs">
    <div class="panel-header-select">
		<label><{#_LB_GARAGEHOLDER#}></label>
	</div>
</div>
<div class="buttons_action" align="right">
	<button type="button" onClick="filterp()">
	    <img alt="" src="<{$smarty.const.STATIC_COMPONENT_URL}>images/search_16.png"/>
	    <{#_LB_SEARCH#}>
	</button>	
	<form name="filter" method="post" action="">
		<table>
			<tr>
				<td><{#_LB_DATE#}>: </td>
				<td><input name="date_create" type="text" id="datepicker" /></td>
				<td width="20"></td>
			</tr>
		</table>
	</form>
</div>
<br/>
<table class="grid">				
	<tr class="head">
        <td width="10%"><{#_LB_VISITOR_ID#}></td>	
		<td width="20%"><{#_LB_VISITOR_FULLNAME#}></td>	
		<td width="20%"><{#_LB_VISITOR_EMAIL#}></td>
		<td width="20%"><{#_LB_VISITOR_PHONE#}></td>
		<td width="20%"><{#_LB_VISITOR_ADDRESS#}></td>
		<td width="20%"><{#_LB_VISITOR_GARAGE#}></td>
		<td width="20%"><{#_LB_VISITOR_DATECREATE#}></td>
		<td width="20%"><{#_LB_VISITOR_DESC#}></td>
		<td width="10%"><{#_LB_FUNCTION#}></td>				
	</tr>
	<{while $visitor->fetch()}>
		<tr>
            <td><{$visitor->id}></td>
			<td><{$visitor->fullname}></td>
			<td><{$visitor->email}></td>
			<td><{$visitor->phonenumber}></td>
			<td><{$visitor->address}></td>
			<td><{$visitor->garage_name}></td>
			<td><{$visitor->date_create|date_format:#_DATE_FORMAT_INPUT#}></td>
			<td><{$visitor->description}></td>
			<td>
			<{if $visitor->status == 0}>
				<a href="<{$smarty.const.APPLICATION_URL}>/admin/visitor/action/active/id/<{$visitor->id}>" title="edit" >
					<img border=0 alt="edit_small.png" src="<{$smarty.const.STATIC_COMPONENT_URL}>images/search_small.png"/>						
				</a>
			<{else}>
				<img border=0 alt="edit_small.png" src="<{$smarty.const.STATIC_COMPONENT_URL}>images/blank.png"/>		
			<{/if}>
				<a onclick="return confirm('<{#_LB_DELETE_CONFIRM#}>')" href="<{$smarty.const.APPLICATION_URL}>/admin/visitor/action/delete/id/<{$visitor->id}>" title="delete" >
					<img border=0 alt="delete_small.png" src="<{$smarty.const.STATIC_COMPONENT_URL}>images/delete_small.png"/>						
				</a>		
			</td>
		</tr>
	<{/while}>	
</table>	

<div align="right">
	<{include file='pager.html' data=$visitor->getPaginationData() url_base=$url_base}>
</div>


<{include file="admin/footer.html"}>